import request from '@/config/axios'

export interface ProductionPrepareVO {
  inventoryNumber: string
  orderNumber: string
  dictOrderType: number
  customerCode: string
  customerName: string
  productNumber: string
  productName: string
  productStandard: string
  creatorName: string
  updaterName: string
  proofreader: string
  proofreaderOpinion: string
  approverName: string
  approverOpinion: string
}

// 查询生产管理--产品管理--备货清单列表
export const getProductionPreparePage = async (params) => {
  return await request.get({ url: `/produce/production-prepare/page`, params })
}

// 查询生产管理--产品管理--备货清单详情
export const getProductionPrepare = async (id) => {
  return await request.get({ url: `/produce/production-prepare/get?id=` + id })
}

// 新增生产管理--产品管理--备货清单
export const createProductionPrepare = async (data: ProductionPrepareVO) => {
  return await request.post({ url: `/produce/production-prepare/create`, data })
}

// 修改生产管理--产品管理--备货清单
export const updateProductionPrepare = async (data: ProductionPrepareVO) => {
  return await request.put({ url: `/produce/production-prepare/update`, data })
}

// 删除生产管理--产品管理--备货清单
export const deleteProductionPrepare = async (id: number) => {
  return await request.delete({ url: `/produce/production-prepare/delete?id=` + id })
}

// 导出生产管理--产品管理--备货清单 Excel
export const exportProductionPrepare = async (params) => {
  return await request.download({ url: `/produce/production-prepare/export-excel`, params })
}
//获取订单信息
export const getOrderInfo = async (params) => {
  return await request.get({url:`/produce/production-shipping-task-order/page`,params})
}
//获取部件信息
export const getComponentInfo = async (params) => {
  return await request.get({url:`/produce/production-incoming/page`,params})
}
// 保存生产管理--产品管理--备货清单
export const saveProductionPrepare = async (data) => {
  return await request.post({ url: `/produce/production-prepare/create`, data })
}
// 编辑保存生产管理--产品管理--备货清单
export const saveUpdateProductionPrepare = async (data) => {
  return await request.put({ url: `/produce/production-prepare/update`, data })
}
// 提交生产管理--产品管理--备货清单
export const submitProductionPrepare = async (data) => {
  return await request.post({ url: `/produce/production-prepare/submit`, data })
}
// 撤回生产管理--产品管理--备货清单
export const withdraw = async (data) => {
  return await request.post({ url: `/produce/production-prepare/withdraw`, data })
}
// 作废生产管理--产品管理--备货清单
export const cancelData = async (data) => {
  return await request.post({ url: `/produce/production-prepare/cancel`, data })
}